<?php
header("Content-Type: text/html;charset=utf-8");

function sendMail($to){

    require 'smtp.php';
    $host = "smtp.qq.com"; //SMTP服务器
    $port = 25; //SMTP服务器端口
    $send_email = "2258162185@qq.com"; //发件方邮箱
    $send_user = "2258162185@qq.com"; //发件方帐号（可以写 764856030 ）
    $pasd = "cswovhdciuljdhhd"; //SMTP服务器授权密码
    $smtp = new smtp($host, $port, $send_user, $pasd, true); 

    $smtp->debug =false;//当请求不成功的时候，换成true 可以看到错误信息
    $type = "HTML"; //信件类型，文本:text；网页：HTML
    $title = "邮箱激活测试"; //邮件主题
    $content = "亲爱的sdhkfj<br/>请点击链接进行邮箱认证。<br/>".
          "< a href='' target='_blank'>请点击我</ a>".
          "<br/>如果以上链接无法点击，请将它复制到你的浏览器地址栏中进入访问，该链接2小时内有效。";


    $rs = $smtp->sendmail($to, $send_email, $title, $content, $type);
    return $rs;
}

$status = sendMail('2648443855@qq.com');

if($status){
    echo "发送邮件成功！";
}else{
    echo "发送邮件失败！";
}

?>